/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "NIVEAUANALYSE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Niveauanalyse.findAll", query = "SELECT n FROM Niveauanalyse n"),
    @NamedQuery(name = "Niveauanalyse.findByIdNa", query = "SELECT n FROM Niveauanalyse n WHERE n.idNa = :idNa"),
    @NamedQuery(name = "Niveauanalyse.findByNa", query = "SELECT n FROM Niveauanalyse n WHERE n.na = :na")})
public class Niveauanalyse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_NA")
    private Integer idNa;
    @Basic(optional = false)
    @Column(name = "NA")
    private String na;
    @OneToMany(mappedBy = "na")
    private Collection<Comptea> compteaCollection;

    public Niveauanalyse() {
    }

    public Niveauanalyse(Integer idNa) {
        this.idNa = idNa;
    }

    public Niveauanalyse(Integer idNa, String na) {
        this.idNa = idNa;
        this.na = na;
    }

    public Integer getIdNa() {
        return idNa;
    }

    public void setIdNa(Integer idNa) {
        this.idNa = idNa;
    }

    public String getNa() {
        return na;
    }

    public void setNa(String na) {
        this.na = na;
    }

    @XmlTransient
    public Collection<Comptea> getCompteaCollection() {
        return compteaCollection;
    }

    public void setCompteaCollection(Collection<Comptea> compteaCollection) {
        this.compteaCollection = compteaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idNa != null ? idNa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Niveauanalyse)) {
            return false;
        }
        Niveauanalyse other = (Niveauanalyse) object;
        if ((this.idNa == null && other.idNa != null) || (this.idNa != null && !this.idNa.equals(other.idNa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Niveauanalyse[ idNa=" + idNa + " ]";
    }
    
}
